<?php
/*
 * Set timestamp of latest activity.
 */

// authenticate user first
F3::call('authentication.php');
if (F3::exists('auth_error'))
{
  // authentication failed
  return;
}

$id = F3::get('SESSION.user_id');

// insert latest activity
$param = array('1'=>$id);
DB::sql("update user set latest_activity=now() where id=?",$param);

// success
header('HTTP/1.1 204');
header("Content-Type: application/json");
$response = "success";
echo json_encode($response);
return;
?>
